﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Data;
using System.Web.Configuration;
using System.DirectoryServices;

/// <summary>
/// Summary description for LDAPService
/// </summary>
[WebService(Namespace = "http://www.avila.edu/WebServices/ldap/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
// [System.Web.Script.Services.ScriptService]
public class LDAPService : System.Web.Services.WebService {
    string adminUser = WebConfigurationManager.AppSettings["adAdminUser"];
    string adminPassword = WebConfigurationManager.AppSettings["adAdminPassword"];
    string _path = "LDAP://10.11.20.243/OU=Accounts,DC=avila,DC=edu";
  

    DataSet ds;
    LDAPHelp ldap = new LDAPHelp();
    public LDAPService () {

        //Uncomment the following line if using designed components 
        //InitializeComponent(); 
    }

    [WebMethod]
    public DataSet GetDetails(string user){

        ds = ldap.getDetailsBy(user);
        return ds;
    }
    string name;
    [WebMethod]
    public string CurrentUsersADInfo(string user )
    {
        name = ldap.CurrentUsersADInfo(user);
        return name;
    }
}

